home *** CD-ROM | disk | FTP | other *** search
/ Computer Inter@ctive 17 / Computer Interactive cdrom 17 - gen 99.iso / ZDNETIT / CONTENT / ACESOFT.ZIP / ASWIT120.TXT < prev    next >
Encoding:
Text File  |  1998-11-01  |  5.2 KB  |  142 lines

  1. PAGE 56,80
  2. @FILENAME       EQU <ASWIT.COM>
  3. COMMENT |
  4. *****************************************************************************
  5. Date:           21/01/98 - 10/10/98.
  6. Last Edit:    10/10/98.
  7. File Name:      ASWIT120.ASM.
  8. Description:    ACESOFT SUBLIMATE WRITING INTO TEXT.
  9. Version:        1.20 FOURTH MAJOR VERSION.
  10. Purpose:        A command line text file ASC2 normaliser.
  11. OutputFormat:   Initially as a .COM file.
  12.         Watch this space for a WINDOWS version.
  13. Comments:       Decided to develop this to automate HTML text extraction.
  14.  
  15.         It's a funny old world - but on playing with the Internet
  16.         some more..................
  17.  
  18. Objectives:
  19.         Open file for input if extant else quit.
  20.         Open file for output if not *.asw format else quit.
  21.         Check if input file *.html, or *.hst set flag if it is.
  22.         Get bytes using a subroutine with a eof dropout to close all.
  23.  
  24. HTML:
  25.      Look for " on same line:
  26.               does it contain HTTP/http \ or / (it must have no spaces):
  27.           if so write line with " deliniators till repeat of " or '<CR>'.
  28.           *N.B. Can't use ' type deliniator!!!!!!!!!
  29.  
  30. HST/WBS:
  31.     Look for HTTP/http and x:\........
  32.          write line with " deliniators till character equal or below 0Dh.
  33.      lines are assumed to terminate on 0 (NUL) or >=80h characters.
  34.  
  35. Any Other:
  36.  
  37.     File must be pre-read to find out whether strings of 0Ah exist in odd or
  38. even numbers etc.:
  39.              Lone 0Dhs must each be converted to 0D0Ah characters.
  40.              Lone 0Ahs must each be converted to 0D0Ah characters.
  41.              Paired 0Ahs (0A0Ahs) must be converted to 0D0Ah characters.
  42.              0D0Ah characters must be ignored.
  43.                    Lone 0Dhs = NULType 1 (bit 0).
  44.                    Lone 0Ahs = NULType 2 (bit 1).
  45.                    Paired 0Ahs (0A0Ahs) = NULType 128 (bit 7)
  46.                    0D0Ah = NULType 0 (NUL).
  47. All four represent distinct types of ASC2 text file and have to be treated
  48. accordingly.
  49.  
  50.     Replace single #0s or #0 strings with a single rtn ***** IMPROVED FROM 1.1.
  51.     ALSO CHR 01AH == EOF must be changed for space characters **** NOT DONE 1.1.
  52.     Replace 0Ah type returns with full 0Dh,0Ah ones.
  53.     Else copy character.
  54.  
  55.  
  56. ShareWare Version:
  57.           The ShareWare Version    of ASWIT will have a file length restriction
  58. built into it to encourage registration.
  59.  
  60. Additions for v1.10: 
  61. 1).    'FAT.DB' should be reccognised as a '*.HST' type file.
  62. .........................................Done.
  63.  
  64. 2).    The 'HTML' processing routine should have a more intelligent way of 
  65. handling strings with spaces.
  66. .........................................Done.
  67.  
  68. 3).    The 'HTML' processing routine should also contain a search for '.htm'
  69. and '.HTM' throughout any likely strings, in the same way as 'HTML'......
  70. ..........................................JPG/GIF also done.
  71.  
  72. 4).    A string such as 'HnHTTP://..........' can fool the 'HST' handler.
  73. ...........................................Now searches all string.
  74.  
  75. 5).    Though the kernal routine is useful as a compact assembly COM file a
  76. Windows loader in a high level language (VB) would make it more user friendly.
  77. .........................................See Visual Basic loader.
  78.  
  79. 6).     Stop command line accepting strings of spaces as file names.
  80. .........................................Done.
  81.  
  82. Additions for v1.20: 
  83.  
  84. 1).    ASCII processor should replace #0 strings with a single rtn.
  85. .........................................Improved.
  86.  
  87. 2).    ASCII processor should replace any #01Ah (text eof chr) with a #020h (spc).
  88. .........................................Done.
  89.  
  90. 3).    The 'HTML' processing routine should also contain a search for '.pl',
  91. '.ra', '.mov', '.exe', '.com', '.cgi', '.arj', 'jpe', 'jfi' and '.zip'. 
  92. .........................................
  93.  
  94. *****************************************************************************
  95.  
  96. Error Returns:
  97.  
  98. 0). Use: ASWIT [PATH]FILENAME.TYPE<Return>.
  99. 1). Name/path too long i.e. <= 63+8+4==75-4 (for an extra file type if needed).
  100. 2). Bad file name given.
  101. 3). Illegal file type.
  102. 4). Sorry I won't operate on an ASW file, they're my children.
  103. 5). Error opening input file.
  104. 6). Error opening output file.
  105. 7). Error reading input file.
  106. 8). Error writing output file.
  107. 9). Error closing input file.
  108. 10). Error closing output file.
  109. 11). Job done, no errors.
  110. 12). Bad program environment.
  111. 13). Must use DOS 3 or higher.
  112.  
  113. *****************************************************************************
  114. |
  115.         MASM
  116.         .MODEL TINY, NOLANGUAGE ;;ASSEMBLER WINDOWS
  117.         .8086
  118. ;;              .386
  119.         .SEQ
  120. ;;                .STACK 100h
  121.         %CREF
  122.  
  123. ;;                .DATA
  124.         .CONST
  125. TRUE            = 1
  126. FALSE           = 0
  127. NUL             = 0
  128. ;
  129. DTest           = 0     ;;1=Test of unscrambled ASWIT.COM file.
  130. ATest           = 0     ;;1=Test of NUL File type.
  131. ShareWare       = 1     ;;1=ShareWare, 0=Registered.
  132. ;
  133. SWLimit         = 25    ;;i.e. 24*255 bytes = 6k, plus one
  134. HTML            = 1     ;;HTML input file type.
  135. HST             = 2     ;;HST input file type.
  136. ASW             = 4     ;;ASW input file type.
  137.  
  138. StartAswit      PROC NOWINDOWS ;;WINDOWS
  139.         .CODE
  140.         ORG 100h
  141. AswitCode:      ;;************************************************************
  142.